package org.shan.security.oaresource.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by amanda.shan on 2019/3/10.
 */
@RestController
public class SecrityController {

    private static final Logger log = LoggerFactory.getLogger(SecrityController.class);

    @GetMapping("/user")
    public Authentication getUser(Authentication authentication) {
        log.info("resource: user {}", authentication);
        return authentication;
    }

    @GetMapping("/data")
    public String getData() {
        return "data";
    }
}
